package com.usian.controller;


import com.usian.utils.FastDFSClientUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
public class FastTestController {
    /**
     *
     */
    @Autowired
    public FastDFSClientUtil fastDFSClientUtil;
    @RequestMapping("/upload")
    public String upload(MultipartFile file){
        String path = null;
        try {
            path = fastDFSClientUtil.uploadFile(file);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return path;
    }
}
